from math import sqrt

def isPrime(n):
    if n <= 1:
        return False
    if n == 2:
        return True
    for i in range(2, sqrt(n)+1):
        if n % i == 0:
            return False